<?php
class CommentsView extends View{
    public static function getMessagesBox($data) {
        $out = '';
        $out.="<div class='span6'>
             <div class='table-messages'>
             <h4>Комментарии:</h4>";
        if(count($data)>0)
        {
        foreach ($data as $message) {
            $out.='<hr><div class="message-container"><div class="message-info"><span>от: '.$message['from'].'</span><span class="message-date">дата: '.$message['date'].'</span></div>';
            $out.='<div class="message-data">'.$message['message'].'</div></div>';
           
        }
        }
        else
        {
            $out.="<div>Нет сообщений</div>";
        }
        $out.="</div></div>";
        return $out;
    }

    public static function getAddBox() {
        return '
<div class="span6">
    <hr>
    <div class="table-add-comment">
                    <h4>Добавить комментарий</h4>
                    <form class="form-horizontal" method="POST">
            <fieldset>
                <div class="control-group">
                    <textarea name="message" class="comments">
                                  
                    </textarea>
                </div>
                <div class="form-actions">
                    <input name="submit" type="submit" value="Добавить" class="btn btn-primary"> 
                </div>
            </fieldset>
        </form>
    </div>
</div>';
    }

}
?>